widget: Remove gtk_widget_get_border_allocation
authorTimm Bäder <mail@baedert.org>
Mon, 14 Aug 2017 10:20:42 +0000 (12:20 +0200)
committerTimm Bäder <mail@baedert.org>
Mon, 14 Aug 2017 10:22:39 +0000 (12:22 +0200)
gtk/gtkcolorswatch.c
gtk/gtkentry.c
gtk/gtknotebook.c
gtk/gtkrange.c
gtk/gtkscale.c
gtk/gtkwidget.c
gtk/gtkwidgetprivate.h

index e24fa2e21f6de6418991c3ebe87dbade7ac40d3a..c14f7460dee5dc11a0fc2421ddfdd0c643b72e61 100644 (file)
@@ -98,18 +98,17 @@ swatch_snapshot (GtkWidget   *widget,
     {
       cairo_pattern_t *pattern;
       cairo_matrix_t matrix;
-      GtkAllocation border_allocation;
+      int width, height;
       GskRoundedRect content_box;
 
-      gtk_widget_get_border_allocation (widget, &border_allocation);
+      gtk_widget_get_content_size (widget, &width, &height);
 
       gtk_rounded_boxes_init_for_style (NULL,
                                         NULL,
                                         &content_box,
                                         gtk_style_context_lookup_style (context),
                                         0, 0,
-                                        border_allocation.width,
-                                        border_allocation.height);
+                                        width, height);
       gtk_snapshot_push_rounded_clip (snapshot,
                                       &content_box,
                                       "ColorSwatchClip");
index b05bfe2a4edf6f29ebd26cfe1ad6e690e64016e8..26fd08dc281a8d6b1980953ba677f80e4fd2922a 100644 (file)
@@ -7961,9 +7961,8 @@ gtk_entry_get_icon_at_pos (GtkEntry *entry,
       if (icon_info == NULL)
         continue;
 
-      gtk_widget_get_border_allocation (icon_info->widget, &allocation);
-      if (x >= allocation.x && x < allocation.x + allocation.width &&
-          y >= allocation.y && y < allocation.y + allocation.height)
+      gtk_widget_get_outer_allocation (icon_info->widget, &allocation);
+      if (gdk_rectangle_contains_point (&allocation, x, y))
         return i;
     }
 
index fc80e5a3fa398ec03b836f822de4b3ead2835645..82068ca266a4c061ed19fecaed8e4fc5ebd508d2 100644 (file)
@@ -2412,7 +2412,7 @@ get_drop_position (GtkNotebook *notebook)
         {
           GtkAllocation allocation;
 
-          gtk_widget_get_border_allocation (page->tab_widget, &allocation);
+          gtk_widget_get_outer_allocation (page->tab_widget, &allocation);
 
           switch (priv->tab_pos)
             {
index 2f213522162fce8b3c04b6eac68e7dfc3401ba12..d10f3bd14de7cbcb431d57b5dc7a8350730cdb57 100644 (file)
@@ -2705,7 +2705,7 @@ gtk_range_update_mouse_location (GtkRange *range)
   y = priv->mouse_y;
 
   gtk_widget_get_own_allocation (widget, &range_alloc);
-  gtk_widget_get_border_allocation (priv->trough_widget, &trough_alloc);
+  gtk_widget_get_outer_allocation (priv->trough_widget, &trough_alloc);
 
   gtk_widget_get_outer_allocation (priv->slider_widget, &slider_alloc);
   gtk_widget_translate_coordinates (priv->trough_widget, widget,
index dc72a09abbf14376b3c27e0df3f7e195ee72051b..48ff14fab5c7a00fa5debf45dc675bda389044c5 100644 (file)
@@ -333,7 +333,7 @@ gtk_scale_allocate_value (GtkScale      *scale,
   gtk_widget_get_content_size (widget, &range_width, &range_height);
 
   slider_widget = gtk_range_get_slider_widget (range);
-  gtk_widget_get_border_allocation (slider_widget, &slider_alloc);
+  gtk_widget_get_outer_allocation (slider_widget, &slider_alloc);
 
   gtk_widget_measure (priv->value_widget,
                       GTK_ORIENTATION_HORIZONTAL, -1,
index f53ce85fd3b9c002162a821a3139b3a9b7d6b3fa..014552febd94da1c25095182afc6952adca908bb 100644 (file)
@@ -13272,28 +13272,6 @@ gtk_widget_get_content_size (GtkWidget *widget,
              margin.bottom + border.bottom + padding.bottom;
 }
 
-void
-gtk_widget_get_border_allocation (GtkWidget     *widget,
-                                  GtkAllocation *allocation)
-{
-  GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
-  GtkBorder margin, border;
-  GtkCssStyle *style;
-
-  style = gtk_css_node_get_style (priv->cssnode);
-  get_box_margin (style, &margin);
-  get_box_border (style, &border);
-
-  *allocation = priv->allocation;
-
-  allocation->x += margin.left + border.left;
-  allocation->y += margin.top + border.top;
-  allocation->width -= margin.left + border.left +
-                       margin.right + border.right;
-  allocation->height -= margin.top + border.top +
-                        margin.bottom + border.bottom;
-}
-
 /**
  * gtk_widget_get_allocated_width:
  * @widget: the widget to query
index 93dcbcac8e0ff44e210205ce1da7cdd63c2c4b80..5a3472863ae8cbfe2c65a720d895d43fd53e4946 100644 (file)
@@ -314,8 +314,6 @@ void              gtk_widget_focus_sort                    (GtkWidget        *wi
 gboolean          gtk_widget_focus_move                    (GtkWidget        *widget,
                                                             GtkDirectionType  direction,
                                                             GPtrArray        *focus_order);
-void              gtk_widget_get_border_allocation         (GtkWidget        *widget,
-                                                            GtkAllocation    *allocation);
 void              gtk_widget_get_outer_allocation          (GtkWidget        *widget,
                                                             GtkAllocation    *allocation);
 void              gtk_widget_get_own_allocation            (GtkWidget        *widget,